<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<script src="https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
<body>
    user
    <a href="/shopping/game">game</a>

    <button id="selectAll">查询所有商品</button>

    <div id="show"></div>
</body>

<script>
    $("#selectAll").click(function () {
        $.ajax({
            type:"get",
            url:"/shopping/selectAll",
            success:function (data) {
                var list=JSON.parse(data);
                $("#show").html("")
                for(var i=0;i<list.length;i++){
                    $("#show").append(list[i].goodId).append("  "+list[i].goodName)
                    $("#show").append("<br>")
                }
            }
        })
    })
</script>
</html>